< previous page page_776 next page >

Page 776
This code uses the Synchronize method to copy changes from REPLMAST.MDB to COPY.MDB, and vice versa.
Run the project and click the Synchronize button. You receive a dialog box notifying you when the synchronization is complete. Stop the program by selecting Exit.
Note.gif
It is a good practice to compact your database (repair it first, if necessary) before you perform a synchronization. This ensures that you are not replicating potentially damaged records that might propagate throughout the entire replica set.

Now open Visdata once more and load the COPY.MDB database. Look first at the BookSales table and notice that it now reflects the data change you made previously in the REPLMAST.MDB database. Open the Authors table. Notice how the s_Generation field has been updated for the new and the changed records. This is illustrated in Figure 20.15.
0776-01.jpg
Figure 20.15.
Data after synchronization. Notice that the
s_Generation field has a new value.
The s_Generation field is incremented by 1 each time a record is changed and a synchronization is performed. The replica keeps track of the last record sent to a particular member of the replica set, and only sends records with record numbers that are greater than the last record sent, and of course, all records with an s_Generation value of zero.

 
< previous page page_776 next page >

If you like this book, buy it!